package com.miplus.ccrm.core.controller;

import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.miplus.ccrm.common.*;
import com.miplus.ccrm.core.controller.vo.action.*;
import com.miplus.ccrm.core.controller.vo.action.StopCaseListVo;
import com.miplus.ccrm.core.controller.vo.credit.CrdCaseReqVo;
import com.miplus.ccrm.core.controller.vo.credit.CrdCaseResVo;
import com.miplus.ccrm.core.controller.vo.credit.FiTaskReqVo;
import com.miplus.ccrm.core.controller.vo.cust.StopCustomerListReqVo;
import com.miplus.ccrm.core.controller.vo.file.UploadResVo;
import com.miplus.ccrm.core.security.JCommonData;
import com.miplus.ccrm.core.service.action.*;
import com.miplus.ccrm.core.service.crd.FiCreditcasesService;
import com.miplus.ccrm.core.service.file.FiApplyAttService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import javax.validation.constraints.NotNull;
import java.util.ArrayList;
import java.util.List;

/**
 * 2-5.案件基础操作服务接口
 */
@CrossOrigin(origins = "*", maxAge = 3600)
@RestController
@Slf4j
@RequestMapping("/act")
public class ActionController {
    @Resource
    private FiVisitService fiVisitService;
    @Resource
    private FiStopcallService fiStopcallService;
    @Resource
    private FiDelayService fiDelayService;
    @Resource
    private FiReturnService fiReturnService;
    @Resource
    private FiReliefService fiReliefService;
    @Resource
    private FiDeadService fiDeadService;
    @Resource
    private FiAmortService fiAmortService;
    @Resource
    private FiAmortDetailService fiAmortDetailService;
    @Resource
    private FiApplyAttService fiApplyAttService;
    @Resource
    private FiDeductService fiDeductService;
    @Resource
    private JCommonData jCommonData;
    @Resource
    private SmsSendphnService smsSendphnService;

    @Resource
    private FiCreditcasesService fiCreditcasesService;

    /**
     * 取停催GRID
     */
    @GetMapping("/fiStopCallList")
    public R<PageData<FiStopResVo>> fiStopCallList(@Validated FiStopReqVo fiStopReqVo){
        JSysUser user= jCommonData.getCurrUsr();
        return R.SuccessPage(fiStopcallService.fiStopCallList(user,fiStopReqVo));
    }

    /**
     * 停催导出
     * 短信、电话列表导出
     */
    @PostMapping("/expFiStopCall")
    public R<CmdResVo> expFiStopCall(@RequestBody @Validated FiStopReqVo fiStopReqVo,HttpServletResponse response){
        JSysUser user= jCommonData.getCurrUsr();
        return R.Success(fiStopcallService.expFiStopCall(user,fiStopReqVo,response));
    }


    /**
     * 取案件停催GRID
     */
    @PostMapping("/fiStopCaseList")
    public R<PageData<FiStopCaseResVo>> fiStopCaseList(@RequestBody @Validated FiStopReqVo fiStopReqVo){
        JSysUser user= jCommonData.getCurrUsr();
        return R.SuccessPage(fiStopcallService.fiStopCaseList(user,fiStopReqVo));
    }

    /**
     * 案件停催导出
     */
    @PostMapping("/expFiStopCase")
    public R<CmdResVo> expFiStopCase(@RequestBody @Validated FiStopReqVo reqVo,HttpServletResponse response){
        JSysUser user= jCommonData.getCurrUsr();
        return R.Success(fiStopcallService.expFiStopCase(user,reqVo,response));
    }


    /**
     * 取客户停催GRID
     */
    @PostMapping("/fiStopCustomerList")
    public R<PageData<FiStopCustomerResVo>> fiStopCustomerList(@RequestBody @Validated FiStopCustomerReqVo reqVo){
        JSysUser user= jCommonData.getCurrUsr();
        return R.SuccessPage(fiStopcallService.fiStopCustomerList(user,reqVo));
    }

    /**
     * 客户停催导出
     */
    @PostMapping("/expFiStopCustomer")
    public R<CmdResVo> expFiStopCustomer(@RequestBody @Validated FiStopCustomerReqVo reqVo,HttpServletResponse response){
        JSysUser user= jCommonData.getCurrUsr();
        return R.Success(fiStopcallService.expFiStopCustomer(user,reqVo,response));
    }

    /**
     * 添加停催申请
     */
    @PostMapping("/fiStopCallAdd")
    public R<CmdResVo> fiStopCallAdd(@RequestBody @Validated FiStopAddVo fiStopAddVo){
        String usrid= jCommonData.getCurrUsrID();
        return R.Success(fiStopcallService.fiStopCallAdd(usrid,fiStopAddVo));
    }

    /**
     * 取消停催申请
     */
    @PostMapping("/fiStopCallCancel")
    public R<CmdResVo> fiStopCallCancel(@RequestBody @Validated FiApplyCancelVo fiApplyCancelVo){
        String usrid= jCommonData.getCurrUsrID();
        return R.Success(fiStopcallService.fiStopCallCancel(usrid,fiApplyCancelVo));
    }

    /**
     * 审批停催申请
     */
    @PostMapping("/fiStopCallConfirm")
    public R<CmdResVo> fiStopCallConfirm(@RequestBody @Validated FiApplyConfirmVo fiApplyConfirmVo){
        String usrid= jCommonData.getCurrUsrID();
        return R.Success(fiStopcallService.fiStopCallConfirm(usrid,fiApplyConfirmVo));
    }

    /**
     * 终止停催
     */
    @PostMapping("/fiStopCallEnd")
    public R<CmdResVo> fiStopCallEnd(@RequestBody @Validated FiApplyCancelVo fiApplyCancelVo){
        String usrid= jCommonData.getCurrUsrID();
        return R.Success(fiStopcallService.fiStopCallEnd(usrid,fiApplyCancelVo));
    }

    /**
     * 批量添加停催（CALL,SMS）
     */
    @PostMapping("/fiStopCallListAdd")
    public R<CmdResVo> fiStopCallListAdd(@RequestBody @Validated StopCallListVo stopCallListVo){
        String usrid= jCommonData.getCurrUsrID();
        return R.Success(fiStopcallService.fiStopCallListAdd(usrid,stopCallListVo));
    }

    /**
     * 批量停催案件
     */
    @PostMapping("/fiStopCaseListAdd")
    public R<CmdResVo> fiStopCaseListAdd(@RequestBody @Validated StopCaseListVo stopCaseListVo){
        JSysUser jSysUser = jCommonData.getCurrUsr();
        String usrid= jCommonData.getCurrUsrID();
        CrdCaseReqVo quyparas=null;
        if(ObjectUtils.isNotNull(stopCaseListVo.getIsasquery()) && stopCaseListVo.getIsasquery() == 1){
            String key=jCommonData.getStopCaseKey(usrid);
            //有效期2小时
            Object o=jCommonData.getData(key);
           if(o==null){
                log.warn("fiCaseAssgin:nofind {}",key);
                return R.Error(EnumRCode.NoFindQuyPara);
            }else{
                quyparas=(CrdCaseReqVo)o;
                List<Integer> crdList = new ArrayList<>();
                int cnt = fiCreditcasesService.bindFiCastList(crdList,jSysUser,quyparas);
                if(cnt > 0)
                    stopCaseListVo.setCaselist(crdList);
            }
        }
        return R.Success(fiStopcallService.fiStopCaseListAdd(usrid,stopCaseListVo));
    }


    /**
     * 批量停催客户
     * @param stopCustomerListVo
     * @return
     */
    @PostMapping("/fiStopCustomerListAdd")
    public R<CmdResVo> fiStopCustomerListAdd(@RequestBody @Validated StopCustomerListReqVo stopCustomerListVo){
        String usrid= jCommonData.getCurrUsrID();
        return R.Success(fiStopcallService.fiStopCustomerListAdd(usrid,stopCustomerListVo));
    }

    /**
     * 批量终止停催（stopid）
     */
    @PostMapping("/fiStopCallEndList")
    public R<CmdResVo> fiStopCallEndList(@RequestBody @Validated List<String> stopcallList){
        String usrid= jCommonData.getCurrUsrID();
        return R.Success(fiStopcallService.fiStopCallEndList(usrid,stopcallList));
    }

    /**
     * 取外访审批GRID
     */
    @GetMapping("/visitList")
    public R<PageData<FiVisitResVo>> visitList(@Validated FiApplyReqVo fiApplyReqVo){
        JSysUser user= jCommonData.getCurrUsr();
        return R.SuccessPage(fiVisitService.visitList(user,fiApplyReqVo));
    }

    /**
     * 取外访记录信息
     */
    @GetMapping("/getVisitInfo")
    public R<FiVisitResVo> getVisitInfo(@RequestParam @NotNull Integer visitnumber){
        return R.Success(fiVisitService.getVisitInfo(visitnumber));
    }

    /**
     * 取外访记录信息通过催记ID
     */
    @GetMapping("/getVisitInfoByTaskID")
    public R<FiVisitResVo> getVisitInfoByTaskID(@RequestParam @NotNull Integer tasknumber){
        return R.Success(fiVisitService.getVisitInfoByTaskID(tasknumber));
    }

    /**
     * 添加外访申请
     */
    @PostMapping("/fiVisitAdd")
    public R<CmdResVo> fiVisitAdd(@RequestBody @Validated FiVisitAddVo fiVisitAddVo){
        String usrid= jCommonData.getCurrUsrID();
        return R.Success(fiVisitService.fiVisitAdd(usrid,fiVisitAddVo));
    }

    /**
     * 取消外访
     */
    @PostMapping("/fiVisitCancel")
    public R<CmdResVo> fiVisitCancel(@RequestBody @Validated FiApplyCancelVo fiApplyCancelVo){
        String usrid= jCommonData.getCurrUsrID();
        return R.Success(fiVisitService.fiVisitCancel(usrid,fiApplyCancelVo));
    }

    /**
     * 审批外访申请
     */
    @PostMapping("/fiVisitConfirm")
    public R<CmdResVo> fiVisitConfirm(@RequestBody @Validated FiApplyConfirmVo fiApplyConfirmVo){
        String usrid= jCommonData.getCurrUsrID();
        return R.Success(fiVisitService.fiVisitConfirm(usrid,fiApplyConfirmVo));
    }

    /**
     * 保存外访结果
     */
    @PostMapping("/fiVisitResult")
    public R<CmdResVo> fiVisitResult(@RequestBody @Validated FiVisitResultVo fiVisitResultVo){
        String usrid= jCommonData.getCurrUsrID();
        return R.Success(fiVisitService.fiVisitResult(usrid,fiVisitResultVo));
    }

    /**
     * 取留案GRID
     */
    @PostMapping("/fiDelayList")
    public R<PageData<FiDelayResVo>> fiDelayList(@RequestBody @Validated FiApplyReqVo fiApplyReqVo){
        String usrid= jCommonData.getCurrUsrID();
        return R.SuccessPage(fiDelayService.fiDelayList(usrid,fiApplyReqVo));
    }

    /**
     * 添加留案申请
     */
    @PostMapping("/fiDelayAdd")
    public R<CmdResVo> fiDelayAdd(@RequestBody @Validated FiDelayAddVo fiDelayAddVo){
        JSysUser usr= jCommonData.getCurrUsr();
        if(ObjectUtils.isNotNull(fiDelayAddVo.getIsassquy()) && fiDelayAddVo.getIsassquy() == 1) {
            String key = jCommonData.getStopCaseKey(usr.getUsrid());
            //有效期2小时
            Object o = jCommonData.getData(key);
            if (o == null) {
                log.warn("fiDelayAdd:nofind {}", key);
                return R.Error(EnumRCode.NoFindQuyPara);
            } else {
                CrdCaseReqVo quyparas = (CrdCaseReqVo) o;
                List<Integer> crdList = new ArrayList<>();
                int cnt = fiCreditcasesService.bindFiCastList(crdList, usr, quyparas);
                if (cnt > 0)
                    fiDelayAddVo.setFicaseids(crdList);
            }
        }
        if(JPubUtils.IsEmpty(fiDelayAddVo.getClid())){
            fiDelayAddVo.setClid("SYS_DELAY"); //此任务是系统配置任务，不能delete
        }
        return R.Success(fiDelayService.fiDelayAdd(usr.getUsrid(),fiDelayAddVo));
    }

    /**
     * 取消留案申请
     */
    @PostMapping("/fiDelayCancel")
    public R<CmdResVo> fiDelayCancel(@RequestBody @Validated FiApplyCancelVo fiApplyCancelVo){
        String usrid= jCommonData.getCurrUsrID();
        return R.Success(fiDelayService.fiDelayCancel(usrid,fiApplyCancelVo));
    }

//    /**
//     * 审批留案申请
//     */
    @PostMapping("/expDelay")
    public R<CmdResVo> expDelay(@RequestBody @Validated FiApplyReqVo fiApplyReqVo, HttpServletResponse response){
        JSysUser user= jCommonData.getCurrUsr();
        return R.Success(fiDelayService.expDelay(user,fiApplyReqVo,response));
    }

    /**
     * 审批留案导出
     */
    @PostMapping("/fiDelayConfirm")
    public R<CmdResVo> fiDelayConfirm(@RequestBody @Validated FiApplyConfirmVo fiApplyConfirmVo){
        String usrid= jCommonData.getCurrUsrID();
        return R.Success(fiDelayService.fiDelayConfirm(usrid,fiApplyConfirmVo));
    }

    /**
     * 取退案GRID
     */
    @GetMapping("/fiReturnList")
    public R<PageData<FiReturnResVo>> fiReturnList(@Validated FiApplyReqVo fiApplyReqVo){
        String usrid= jCommonData.getCurrUsrID();
        return R.SuccessPage(fiReturnService.fiReturnList(usrid,fiApplyReqVo));
    }

    /**
     * 添加退案申请
     */
    @PostMapping("/fiReturnAdd")
    public R<CmdResVo> fiReturnAdd(@RequestBody @Validated FiReturnAddVo fiReturnAddVo){
        String usrid= jCommonData.getCurrUsrID();
        return R.Success(fiReturnService.fiReturnAdd(usrid,fiReturnAddVo));
    }

    /**
     * 取消退案申请
     */
    @PostMapping("/fiReturnCancel")
    public R<CmdResVo> fiReturnCancel(@RequestBody @Validated FiApplyCancelVo fiApplyCancelVo){
        String usrid= jCommonData.getCurrUsrID();
        return R.Success(fiReturnService.fiReturnCancel(usrid,fiApplyCancelVo));
    }

    /**
     * 审批退案申请
     */
    @PostMapping("/fiReturnConfirm")
    public R<CmdResVo> fiReturnConfirm(@RequestBody @Validated FiApplyConfirmVo fiApplyConfirmVo){
        String usrid= jCommonData.getCurrUsrID();
        return R.Success(fiReturnService.fiReturnConfirm(usrid,fiApplyConfirmVo));
    }

    /**
     * 取减免GRID
     */
    @GetMapping("/fiReliefList")
    public R<PageData<FiReliefResVo>> fiReliefList(@Validated FiApplyReqVo fiApplyReqVo){
        JSysUser user= jCommonData.getCurrUsr();
        return R.SuccessPage(fiReliefService.fiReliefList(user,fiApplyReqVo));
    }

    /**
     * 添加减免申请
     */
    @PostMapping("/fiReliefAdd")
    public R<CmdResVo> fiReliefAdd(@RequestBody @Validated FiReliefAddVo fiReliefAddVo){
        JSysUser user= jCommonData.getCurrUsr();
        return R.Success(fiReliefService.fiReliefAdd(user,fiReliefAddVo));
    }

    /**
     * 取消减免申请
     */
    @PostMapping("/fiReliefCancel")
    public R<CmdResVo> fiReliefCancel(@RequestBody @Validated FiApplyCancelVo fiApplyCancelVo){
        String usrid= jCommonData.getCurrUsrID();
        return R.Success(fiReliefService.fiReliefCancel(usrid,fiApplyCancelVo));
    }

    /**
     * 审批减免申请
     */
    @PostMapping("/fiReliefConfirm")
    public R<CmdResVo> fiReliefConfirm(@RequestBody @Validated FiApplyConfirmVo fiApplyConfirmVo){
        String usrid= jCommonData.getCurrUsrID();
        return R.Success(fiReliefService.fiReliefConfirm(usrid,fiApplyConfirmVo));
    }

    /**
     * 减免导出
     */
    @PostMapping("/expRelief")
    public R<CmdResVo> expRelief(@RequestBody @Validated FiApplyReqVo fiApplyReqVo, HttpServletResponse response){
        JSysUser user= jCommonData.getCurrUsr();
        return R.Success(fiReliefService.expRelief(user,fiApplyReqVo,response));
    }

    /**
     * 取死亡GRID
     */
    @GetMapping("/fiDeadList")
    public R<PageData<FiDeadResVo>> fiDeadList(@Validated FiApplyReqVo fiApplyReqVo){
        String usrid= jCommonData.getCurrUsrID();
        return R.SuccessPage(fiDeadService.fiDeadList(usrid,fiApplyReqVo));
    }

    /**
     * 添加死亡申请
     */
    @PostMapping("/fiDeadAdd")
    public R<CmdResVo> fiDeadAdd(@RequestBody @Validated FiDeadAddVo fiDeadAddVo){
        String usrid= jCommonData.getCurrUsrID();
        return R.Success(fiDeadService.fiDeadAdd(usrid,fiDeadAddVo));
    }

    /**
     * 取消死亡申请
     */
    @PostMapping("/fiDeadCancel")
    public R<CmdResVo> fiDeadCancel(@RequestBody @Validated FiApplyCancelVo fiApplyCancelVo){
        String usrid= jCommonData.getCurrUsrID();
        return R.Success(fiDeadService.fiDeadCancel(usrid,fiApplyCancelVo));
    }

    /**
     * 审批死亡申请
     */
    @PostMapping("/fiDeadConfirm")
    public R<CmdResVo> fiDeadConfirm(@RequestBody @Validated FiApplyConfirmVo fiApplyConfirmVo){
        String usrid= jCommonData.getCurrUsrID();
        return R.Success(fiDeadService.fiDeadConfirm(usrid,fiApplyConfirmVo));
    }

    /**
     * 取协商分期GRID
     */
    @GetMapping("/fiAmortList")
    public R<PageData<FiAmortResVo>> fiAmortList(@Validated FiApplyReqVo fiApplyReqVo){
        JSysUser user= jCommonData.getCurrUsr();
        return R.SuccessPage(fiAmortService.fiAmortList(user,fiApplyReqVo));
    }

    /**
     * 添加协商分期申请
     */
    @PostMapping("/fiAmortAdd")
    public R<CmdResVo> fiAmortAdd(@RequestBody @Validated FiAmortAddVo fiAmortAddVo){
        JSysUser user= jCommonData.getCurrUsr();
        return R.Success(fiAmortService.fiAmortAdd(user,fiAmortAddVo));
    }

    /**
     * 取消协商分期申请
     */
    @PostMapping("/fiAmortCancel")
    public R<CmdResVo> fiAmortCancel(@RequestBody @Validated FiApplyCancelVo fiApplyCancelVo){
        String usrid= jCommonData.getCurrUsrID();
        return R.Success(fiAmortService.fiAmortCancel(usrid,fiApplyCancelVo));
    }

    /**
     * 审批协商分期申请
     */
    @PostMapping("/fiAmortConfirm")
    public R<CmdResVo> fiAmortConfirm(@RequestBody @Validated FiApplyConfirmVo fiApplyConfirmVo){
        String usrid= jCommonData.getCurrUsrID();
        return R.Success(fiAmortService.fiAmortConfirm(usrid,fiApplyConfirmVo));
    }

    /**
     * 取协商分期明细LIST
     */
    @GetMapping("/fiAmortDetailList")
    public R<List<FiAmortDetailVo>> fiAmortDetailList(@RequestParam @NotNull Integer amortid){
        return R.Success(fiAmortDetailService.fiDetailList(amortid));
    }

    /**
     * 协商分期试算
     */
    @PostMapping("/fiAmortPre")
    public R<List<FiAmortDetailVo>> fiAmortPre(@RequestBody @Validated FiAmortAddVo fiAmortAddVo){
        return R.Success(fiAmortService.fiAmortPre(fiAmortAddVo));
    }

    /**
     * 终止协商分期申请
     */
    @PostMapping("/fiAmortStop")
    public R<CmdResVo> fiAmortStop(@RequestBody @Validated FiApplyCancelVo fiApplyCancelVo){
        String usrid= jCommonData.getCurrUsrID();
        return R.Success(fiAmortService.fiAmortStop(usrid,fiApplyCancelVo));
    }

    /**
     * 协商分期申导出
     */
    @PostMapping("/expAmort")
    public R<CmdResVo> expAmort(@RequestBody @Validated FiApplyReqVo fiApplyReqVo, HttpServletResponse response){
        JSysUser user= jCommonData.getCurrUsr();
        return R.Success(fiAmortService.expAmort(user,fiApplyReqVo,response));
    }

    /**
     * 取申请附件
     */
    @GetMapping("/getApplyAtt")
    public R<List<UploadResVo>> getApplyAtt(@RequestParam @NotNull Integer applynumber,@NotNull String applytype){
        return R.Success(fiApplyAttService.GetApplyFile(applynumber,applytype));
    }

    /**
     * 批量操作死亡标签
     */
    @PostMapping("/fiDeadListAdd")
    public R<CmdResVo> fiDeadListAdd(@RequestBody @Validated DeadListAddVo deadListAddVoList){
        String usrid= jCommonData.getCurrUsrID();
        return R.Success(fiDeadService.fiDeadListAdd(usrid,deadListAddVoList));
    }

    /**
     * 批量操作留案
     */
    @PostMapping("/fiDelayListAdd")
    public R<CmdResVo> fiDelayListAdd(@RequestBody @Validated DelayListAddVo listAddVo){
        String usrid= jCommonData.getCurrUsrID();
        return R.Success(fiDelayService.fiDelayListAdd(usrid,listAddVo));
    }

    /**
     * 取划扣GRID
     */
    @GetMapping("/fiDeductList")
    public R<PageData<FiDedResVo>> fiDeductList(@Validated FiApplyReqVo fiApplyReqVo){
        String usrid= jCommonData.getCurrUsrID();
        return R.SuccessPage(fiDeductService.fiDeductList(usrid,fiApplyReqVo));
    }

    /**
     * 添加划扣申请
     */
    @PostMapping("/fiDeductAdd")
    public R<CmdResVo> fiDeductAdd(@RequestBody @Validated FiDedAddVo fiDedAddVo){
        String usrid= jCommonData.getCurrUsrID();
        return R.Success(fiDeductService.fiDeductAdd(usrid,fiDedAddVo));
    }

    /**
     * 取消划扣申请
     */
    @PostMapping("/fiDeductCancel")
    public R<CmdResVo> fiDeductCancel(@RequestBody @Validated FiApplyCancelVo fiApplyCancelVo){
        String usrid= jCommonData.getCurrUsrID();
        return R.Success(fiDeductService.fiDeductCancel(usrid,fiApplyCancelVo));
    }

    /**
     * 审批划扣申请
     */
    @PostMapping("/fiDeductConfirm")
    public R<CmdResVo> fiDeductConfirm(@RequestBody @Validated FiApplyConfirmVo fiApplyConfirmVo){
        String usrid= jCommonData.getCurrUsrID();
        return R.Success(fiDeductService.fiDeductConfirm(usrid,fiApplyConfirmVo));
    }

    /**
     * 取发送短信明细GRID
     */
    @PostMapping("/smsSendList")
    public R<PageData<SmsResVo>> smsSendList(@RequestBody @Validated SmsReqVo smsReqVo){
        String usrid= jCommonData.getCurrUsrID();
        JSysUser user =  jCommonData.getCurrUsr();
        return R.SuccessPage(smsSendphnService.fiSmsList(user,smsReqVo));
    }


    /**
     * 短信发送内容预览
     */
    @PostMapping("/smsSendPreview")
    public R<SmsSendPreviewResVo> smsSendPreview(@RequestBody @Validated SmsSendPreviewReqVo reqVo){
        String usrid= jCommonData.getCurrUsrID();
        return R.Success(smsSendphnService.smsSendPreview(usrid,reqVo));
    }

    /**
     * 短信发送
     */
    @PostMapping("/smsSendAdd")
    public R<CmdResVo> smsSendAdd(@RequestBody @Validated SmsAddVo smsAddVo){
        String usrid= jCommonData.getCurrUsrID();
        return R.Success(smsSendphnService.fiSmsAdd(usrid,smsAddVo));
    }

    /**
     * 批量发送短信
     * @param smsAddBatchReqVo
     * @return
     */
    @PostMapping("/smsSendBatch")
    public R<SmsAddBatchReqVo> smsSendBatch(@RequestBody @Validated SmsAddBatchReqVo smsAddBatchReqVo){
        JSysUser user= jCommonData.getCurrUsr();

        return R.Success(smsSendphnService.fiSmsAddBatch(user,smsAddBatchReqVo));
    }

    /**
     * 发送短信验证码
     */
    @PostMapping("/smsSendCode")
    public R<CmdResVo> smsSendCode(@RequestBody @Validated SmsCodeVo smsCodeVo) {
        return R.Success(smsSendphnService.fiSmsSendCode(smsCodeVo.getUsrid(),jCommonData));
    }

    /**
     * 短信导出
     */
    @PostMapping("/expSmsList")
    public R<CmdResVo> expSmsList(@RequestBody @Validated SmsReqVo smsReqVo, HttpServletResponse response){
        JSysUser user= jCommonData.getCurrUsr();
        return R.Success(smsSendphnService.expSmsList(user, smsReqVo, response));
    }
}
